<form method="get" id="forma">
    <div class="type-text" style="width: 100px;">
        <?php
        $this->widget('zii.widgets.jui.CJuiDatePicker', array(
            'name' => 'date',
            'value' => date('d-m-Y'),
            'options' => array(
                'dateFormat' => 'dd-mm-yy',
                'changeMonth' => true,
                'changeYear' => true,
                'showAnim' => 'bounce', //'slide','fold','slideDown','fadeIn','blind','bounce','clip','drop'
            ),
            'htmlOptions' => array(
                //'style' => 'height:20px;',
                'class' => 'jqueryPlaceholder',
            ),
        ));
        ?>
        <script>
            $(function() {
                $("#date").change(function() {
                    $('#forma').submit();
                });
            });
        </script>
    </div>
    <input type="hidden" value="<?php echo $mainKey; ?>" name="key">
</form>
<br />
<?php
$table1 = '<table>
    <thead>
        <tr>
            <th>Сотрудник</th>
            <th>Дата</th>
            <th>Обеденное время</th>
        </tr>
    </thead>
    <tbody>';
$table2 = '';
foreach ($selecteds as $user) {
    $table1 .= '<tr>
                    <td>' . $user->user->user_name . '</td>
                    <td>' . $date . '</td>
                    <td>' . $user->lunch_time . '</td>
                </tr>';
}
$table1 .= '</tbody></table>';


$table2 = '<table>
    <thead>
        <tr>
            <th>Сотрудник</th>
            <th>Дата</th>
            <th>Обеденное время</th>
        </tr>
    </thead>
    <tbody>';

foreach ($unselecteds as $user) {
    $table2 .= '<tr>
                    <td>' . $user->user_name . '</td>
                    <td>' . $date . '</td>
                    <td>Не выбран</td>
                </tr>';
}
$table2 .= '</tbody></table>';

$this->widget('zii.widgets.jui.CJuiTabs', array(
    'tabs' => array(
        'Выбравшие' => $table1,
        'Не выбравшие' => $table2,
    ),
    // additional javascript options for the tabs plugin
    'options' => array(
        'collapsible' => true,
    ),
));
?>